<!DOCTYPE html>
<!-- saved from url=(0107)https://mp.weixin.qq.com/advanced/selfmenu?action=index&t=advanced/menu-setting&token=1914593922&lang=zh_CN -->
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <meta name="renderer" content="webkit">
        <meta charset="utf-8">
             <!--js-->
        <script src="{$Think.__STATIC__}/static/template/asset/js/jquery.2.js" type="text/javascript" charset="utf-8"></script>
        <script src="{$Think.__STATIC__}/static/template/asset/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
        <!--ie ...-->
        <script src="{$Think.__STATIC__}/static/system/third/js/layer/layer.js"></script>
        <!-- //公共的JS-FUNCTION函数 -->
        <script src="{$Think.__STATIC__}/static/system/thinkask/PublicVlidate.js" type="text/javascript"></script>



        <link  rel="stylesheet" type="text/css" href="{$Think.__STATIC__}/static/system/weixin/layout_head2880f5.css">
        <link  rel="stylesheet" type="text/css" href="{$Think.__STATIC__}/static/system/weixin/base2fde18.css">
        <link  rel="stylesheet" type="text/css" href="{$Think.__STATIC__}/static/system/weixin/lib2f613f.css">
        <link  rel="stylesheet" href="{$Think.__STATIC__}/static/system/weixin/index2b2fad.css">
        <link rel="stylesheet" type="text/css" href="{$Think.__STATIC__}/static/system/weixin/richvideo2b638f.css">
        <link rel="stylesheet" type="text/css" href="{$Think.__STATIC__}/static/system/weixin/tooltip218878.css">
        <style></style>
    </head>
    <style type="text/css">
      .js_l2Title{font-size: 12px !important;}
    </style>
    <body class="zh_CN">
        <div id="body" class="body page_menu_index" style="padding:0px;width:100%">
            <div id="js_container_box" class="container_box cell_layout side_l">
                <div class="col_main">
                    <div class="main_hd js_menuSetting ">
                        <h2>自定义菜单</h2></div>
                   
                    <div class="menu_setting_area js_editBox">
                        <div class="menu_preview_area">
                            <div class="mobile_menu_preview">
                                <div class="mobile_hd tc"></div>
                                <div class="mobile_bd">
                                    <ul class="pre_menu_list grid_line ui-sortable ui-sortable-disabled" id="menuList">
                                 
                                        
                                   <?php foreach ($wxmenu as  $v): ?>
                                        
                                   <!-- current selected -->
                                        <li class="jsMenu pre_menu_item grid_item jslevel1 ui-sortable ui-sortable-disabled size1of3 <?php if($id==$v['id']){ echo 'current selected';} ?>" id="menu_0">
                                            <a href="/wx/admin/menu/id/{$v.id}/accounts_id/{$accounts_id}" class="pre_menu_link" draggable="false">
                                                <i class="icon_menu_dot js_icon_menu_dot dn"></i>
                                                <i class="icon20_common sort_gray"></i>
                                                <span class="js_l1Title">{$v.name}</span></a>
                                            <div class="sub_pre_menu_box js_l2TitleBox" style="">
                                                <ul class="sub_pre_menu_list">
                                                <?php foreach ($v['children'] as $vi): ?>
                                                    
                                                    <li id="subMenu_menu_0_0" class="jslevel2 <?php if($id==$vi['id']){ echo 'current selected';}?>">
                                                        <a href="/wx/admin/menu/id/{$vi.id}/accounts_id/{$accounts_id}" class="jsSubView tip" id="{$vi.id}" msg="{$vi.name}" draggable="false">
                                                            <span class="sub_pre_menu_inner js_sub_pre_menu_inner">
                                                                <i class="icon20_common sort_gray"></i>
                                                                <span class="js_l2Title">{$vi.name}</span></span>
                                                        </a>
                                                    </li>
                                                 <?php endforeach ?>

                                                  <!--   <li class="js_addMenuBox" style="">
                                                        <a href="javascript:void(0);" class="jsSubView js_addL2Btn" title="最多添加5个子菜单" draggable="false">
                                                            <span class="sub_pre_menu_inner js_sub_pre_menu_inner">
                                                                <i class="icon14_menu_add"></i>
                                                            </span>
                                                        </a>
                                                    </li> -->
                                                </ul>
                                                <i class="arrow arrow_out"></i>
                                                <i class="arrow arrow_in"></i>
                                            </div>
                                        </li>
                                      <?php endforeach ?>
                                                </ul>
                                           
                                      
                                        <li class="js_addMenuBox pre_menu_item grid_item no_extra">
                                            <a href="javascript:void(0);" class="pre_menu_link js_addL1Btn" title="最多添加3个一级菜单" draggable="false">
                                                <i class="icon14_menu_add"></i>
                                            </a>
                                        </li>
                                    </ul>
                                </div>
                            </div>
                            <div class="sort_btn_wrp">
                                <!-- <a id="orderBt" class="btn btn_default" href="javascript:void(0);" style="display: inline-block;">菜单排序</a> -->
                                <span id="orderDis" class="dn btn btn_disabled" style="display: none;">菜单排序</span>
                                <a id="finishBt" href="javascript:void(0);" class="dn btn btn_default">完成</a></div>
                        </div>
                        <div class="menu_form_area">
                            <div id="js_none" class="menu_initial_tips tips_global" style="display: none;">点击左侧菜单进行编辑操作</div>
                            <div id="js_rightBox" class="portable_editor to_left" style="display: block;">
                                <div class="editor_inner">
                                    <div class="global_mod float_layout menu_form_hd js_second_title_bar">
                                        <h4 class="global_info">编辑菜单信息</h4>
                                        <div class="global_extra">
                                            <a href="javascript:void(0);" id="jsDelBt"></a></div>
                                    </div>
                                    <div class="menu_form_bd" id="view">
                                        <!-- <div id="js_innerNone" style="display: block;" class="msg_sender_tips tips_global">已为“{快捷管理}”添加了5个子菜单，无法设置其他内容。</div> -->
                                        <div class="frm_control_group js_setNameBox">
                                            <label for="" class="frm_label">
                                                <strong class="title js_menuTitle">菜单名称</strong></label>
                                            <div class="frm_controls">
                                                <span class="frm_input_box with_counter counter_in append">
                                               
                                                    <input type="text" name="name" value="{$nowmenu.name}" class="frm_input js_menu_name">
                                              
                                                    </span>
                                                <p class="frm_msg fail js_titleEorTips dn" style="display: none;">字数超过上限</p>
                                                <p class="frm_msg fail js_titlenoTips dn" style="display: none;">请输入菜单名称</p>
                                                <p class="frm_tips js_titleNolTips">{$notice}</p></div>
                                        </div>
                                        <div class="frm_control_group show-parentid-hide" style="">
                                            <label for="" class="frm_label">
                                                <strong class="title js_menuContent" id="menucontent" data-menutype="{$nowmenu.type}" data-parentid="{$nowmenu.parentid}">菜单内容</strong></label>
                                            
                                        </div>
                                        <script type="text/javascript">
                                        $(document).ready(function() {
                                            //载入时处理所处的类型
                                            var menutype = $("#menucontent").attr('data-menutype');
                                            if(menutype==""){
                                                //默认的情况
                                                $('#msg-title').addClass('selected');
                                                $('#msg-title').find('label').addClass('selected');
                                                $('#msg').show().siblings('.content').hide();
                                                //设置值 ，方便AJAX传参
                                                $("#menucontent").attr('data-menutype', 'msg');
                                            }else{
                                               $('#'+menutype+'-title').addClass('selected');
                                                $('#'+menutype+'-title').find('label').addClass('selected'); 
                                                //当前类型下面的内容显示
                                                $('.content#'+menutype).show().siblings('.content').hide();
                                               
                                            }

                                            $(".choose-title").click(function(event) {
                                                //样式处理
                                                $(this).addClass('selected').siblings('.choose-title').removeClass('selected');
                                                $(this).find('label').addClass('selected').parents('.choose-title').siblings('.choose-title').find('label').removeClass('selected');
                                                //当前类型下面的内容显示
                                                $("#"+$(this).attr('data-type')).show().siblings('.content').hide();
                                                 //设置值 ，方便AJAX传参
                                                $("#menucontent").attr('data-menutype', $(this).attr('data-type'));

                                            });

                                            //提交保存并且发布
                                            $("#save").click(function(event) {
                                                var id="{$id}";
                                                var accounts_id = "{$accounts_id}";
                                                var name= $("input[name='name']").val();
                                                var menutype = $("#menucontent").attr('data-menutype');
                                                if(menutype==""){
                                                    type="msg";
                                                }else{
                                                    type=$("#menucontent").attr('data-menutype');
                                                }
                                                var url = $("#url").val();
                                                var msg = $("#msg").val();
                                                $(this).html('提交中...');
                                                $(this).css('background', '#ddd');
                                                $.ajax({
                                                    url: '/wx/ajax/savemenu/',
                                                    type: 'post',
                                                    dataType: 'json',
                                                    data: {id: id,name: name,type: type,url: url,msg: msg,accounts_id:accounts_id},
                                                    success:function(d){
                                                        if(d.code>0){
                                                          layer.confirm(d.msg, {
                                                                btn: ['确定'] //按钮
                                                            }, function(){
                                                                // $("#save").html('保存并发布')
                                                                location.reload();  
                                                            });
                                                        }else{
                                                           layer.confirm(d.msg, {
                                                                btn: ['确定'] //按钮
                                                            }, function(){
                                                                // $("#save").html('保存并发布')
                                                                location.reload();  
                                                            });  
                                                        }
                                                    }
                                                })
                                                
                                                
                                            });
                                            
                                        });
                                        </script>
                                        <div class="menu_content_container">
                                        <!-- show-parentid-hide -->
                                            <div class="menu_content send jsMain " id="edit" >
                                                <div class="msg_sender" id="editDiv">
                                                    <div class="msg_tab">
                                                        <div class="tab_navs_panel">
                                                            <span class="tab_navs_switch_wrp switch_prev js_switch_prev">
                                                                <span class="tab_navs_switch"></span>
                                                            </span>
                                                            <span class="tab_navs_switch_wrp switch_next js_switch_next" style="display: none;">
                                                                <span class="tab_navs_switch"></span>
                                                            </span>
                                                            <div class="tab_navs_wrp">
                                                                <ul class="tab_navs js_tab_navs" style="margin-left:0;">
                                                                    <li id="msg-title" data-type="msg" class="tab_nav tab_appmsg width4  choose-title" data-type="10" >
                                                                        <a href="javascript:void(0);" onclick="return false;">&nbsp;
                                                                        <label class="frm_radio_label js_radio_sendMsg " >       
                                                                                <i class="icon_radio"></i>                                       
                                                                                 <span class="lbl_content">文字</span>                                       
                                                                                <input type="radio" name="type" value="msg" class="frm_radio">                                   
                                                                        </label>
                                                                     </a>

                                                                    </li>
                                                                    <li id="url-title" data-type="url" class="tab_nav tab_img width4 choose-title">
                                                                        <a href="javascript:void(0);" onclick="return false;">&nbsp;
                                                                             <label class="frm_radio_label js_radio_sendMsg " data-editing="1">       
                                                                                <i class="icon_radio"></i>                                       
                                                                                 <span class="lbl_content">链接</span>                                       
                                                                                <input type="radio" name="type" value="url" class="frm_radio">                                   
                                                                        </label>
                                                                           
                                                                    </li>
                                                                   
                                                                </ul>
                                                            </div>
                                                        </div>
                                                        <div class="tab_panel">
                                                            <div class="tab_content">
                                                                <div class="js_appmsgArea inner ">
                                                                    <!--type 10图文 2图片 3语音 15视频 11商品消息-->
                                                                    <div class="tab_cont_cover jsMsgSendTab" data-index="0">
                                                                        <textarea class="content" name="msg" id="msg" style="width:100%;height:300px;padding:5px;margin:0px;">{$nowmenu.msg}</textarea>
                                                                        <input    class="content" name="url"id="url" type="text"style="width:100%;padding:0px;margin:0px;height:30px;display:none;" value="{$nowmenu.url}">
                                                                        
                                                                    </div>
                                                                </div>
                                                            </div>
                                                         
                                                        </div>
                                                    </div>
                                                </div>
                                             
                                           
                                           
                                            
                                        </div>
                                    </div>
                                </div>
                                <span class="editor_arrow_wrp">
                                    <i class="editor_arrow editor_arrow_out"></i>
                                    <i class="editor_arrow editor_arrow_in"></i>
                                </span>
                            </div>
                        </div>
                    </div>
                    <div class="tool_bar tc js_editBox">
                        <span id="pubBt" class="btn btn_input btn_primary">
                            <button id="save">保存并发布</button></span>
                        <!-- <a href="javascript:void(0);" class="btn btn_default" id="viewBt">预览</a></div> -->
                </div>
            </div>
                    
        </div>
        </div>
        </div>
       
    </body>

</html>